﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VFTray.Config
{
	public class VibrationFeeder
	{
		public PShakeMove boxparams = new PShakeMove();
		public List<PShakeMove> moves = new List<PShakeMove>();

		public int req_mode = 0;//0: one req one snape; 1:greedy algorithm; only no data to snap
		public PVisionParam vision1 = new PVisionParam();
		public PVisionParam vision2 = new PVisionParam();

		public bool Check_Proportion = false;
		public float Proportion_Limit = 0.5F;
		public VibrationFeeder()
		{
			//if (moves.Count == 0) moves.Add(new PShakeMove());
			//if (snapes.Count == 0) snapes.Add(new PLightSnap());
		}
	}

	public class PShakeMove
	{
		public ushort Mode = 0;
		public ushort Freq = 100;//10.0Hz
		public ushort Volt = 80;//8.0V
		public int Times = 500;//500ms
		public int RestAfter = 100;//
		public int TryCountShake = 2;
		public int TryCountBin = 2;

		public string GetMoveString()
		{
			return string.Format("Mode={0} T={1:F1}", Mode, Times * 0.001);
		}
	}

	public class PLightSnap
	{
		public bool Enabled = false;
		public ushort BrightnessBack = 100;
		public ushort BrightnessFore = 100;
		public int Exposure = 1000;
	}

}
